package 并发编程16.Lock和Condition的使用;

/**
 * @author idea
 * @data 2019/2/17
 */
public class Provider implements Runnable {

    private ProductQueue<Integer> productQueue;

    public Provider(ProductQueue productQueue) {
        this.productQueue = productQueue;
    }

    @Override
    public void run() {
        while (true){
            for(int i=0;i<10;i++){
                System.out.println("------------生产了号码:"+i);
                productQueue.put(i);
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }


    }
}
